

public class lx {

	
	
	public static int[] numArray= {2,3,4,6,7,9,11,15,21,26,33,34,35};
	public static int aimNum =0;
	public static void main(String[] argc){
		
		
	
		
		
		
		aimNum=6;
		int max=numArray.length;
		if(!midFind(0,max-1)) {
			
			
			echo("sorry not find");
		}
		
		
		
		
		
		
		
		
		
	
	}
	
	
	public static boolean midFind(int low , int hight) {
		echoln("the low="+low+" the hight="+hight);
		
		if( low > hight) {//when low=hight find  special example is if you find num is first left or last right  this condition will happen
			//or you find num is on some mid num right or left this condition alse final low = hight
			return false;
		}else {
			
			
			int mid = (low+hight)/2;
			
			if(numArray[mid] == aimNum) {
				
				
				echoln("find order :"+mid);
				echoln("print num is :"+numArray[mid]);
				return true;
			}else if( aimNum > numArray[mid]) {
				
				low=mid+1;
				
				
			}else if( aimNum < numArray[mid]) {
				
				hight = mid-1;
				
				
			}
			
			
			
		}
		
		
		return midFind(low, hight);
		
	}
	
	public static void echo(int  msg){
		
		
		System.out.print(msg);
	}
	public static void echo(String msg){
		
		
		System.out.print(msg);
	}
	public static void echoln(String msg) {
		
		
		echo(msg+"\n");
	}

	

}

